<?php include("dbconfig.php");?>
<div id="post-pic-widget" class="widget w-box photos-widget">	
<h3 class="widget-title"><span>การ์ตูน</span></h3>
	<div class="pt-wrapper">
		<div class="pt-inner clearfix">
			<?php 
			$sql = "SELECT * FROM article WHERE fix_status = 1 AND fix_article_type =8 ORDER BY inserted_date_time DESC LIMIT 6";
			$rsd = mysql_query($sql);
			while($row = mysql_fetch_array($rsd))
			{
				if((bool)preg_match('#<img[^>]+src=[\'"]([^\'"]+)[\'"]#', html_entity_decode($row['description']), $matches))
				{
				   $imageFound = $matches[0];
				   $src = substr($imageFound, strpos($imageFound, "src"));
				}
				else
				{
				  $src = "src=\"images/default_image.png\"";
				}
			?>
				
				<a href="single.php?id=<?php echo $row["article_id"]?>" target="_blank"><img <?php echo $src;?> alt="Patani Forum"></a>								
			<?php }?>
		</div>
		<h5><span><a href="category.php?type=8">อ่านทั้งหมด</a></span></h5>
	</div>

</div>